package com.zghhost.codedemo.zp;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

/**
 * @author guohua.zhang@zhaopin.com.cn
 * @Date 2019/1/3 14:43
 */
public class Gerenxinxi {
    public static void main(String[] args)throws Exception{
        URL u = new URL("http://kaoqin.zhaopin.com/oa/servlet/UserMessageServlet?action=findBaseMessage&findscope=fromsession");
        HttpURLConnection conn = (HttpURLConnection)u.openConnection();
        conn.setRequestProperty("Cookie","JSESSIONID=999C1FFA90510978081EF63FDC46A1F4; BIGipServernginx_pools=620865728.20480.0000; ZPSSO_USER_EMPID=13075301; ZPSSO_USER_NAME=guohua.zhang; ZPSSO_USER_INFO=%7B%22deptName%22%3A%22ZhaoPin+Ltd.%22%2C%22empRole%22%3A%220%22%2C%22isLeader%22%3Afalse%2C%22rdRole%22%3A%220%22%2C%22mngDeptId%22%3A%221%22%2C%22empSpirit%22%3A%220%22%2C%22extension%22%3A%22%22%2C%22ccName%22%3A%22default%22%2C%22deptId%22%3A%221%22%2C%22branchCompanyMngDeptId%22%3A%220%22%2C%22branchCompanyMngDeptName%22%3A%22%E9%9B%86%E5%9B%A2%E6%80%BB%E9%83%A8%22%2C%22salesLevel%22%3A%220%22%2C%22inCallinList%22%3Afalse%7D; ZPSSO_USER_PWD=duLfGp%2BpPulwPI9hLCn0pg%3D%3D");

        BufferedReader bf = new BufferedReader(new InputStreamReader(conn.getInputStream(),"GBK"));

        StringBuffer sb = new StringBuffer();
        String line = null;
        while((line = bf.readLine()) != null){
            sb.append(line);
        }

        System.out.println(sb);
    }
}
